package com.bulemobi.activity.ac_user_centre;

import android.content.Intent;
import android.widget.*;
import com.bulemobi.activity.ac_feedback.AcFeedback;
import com.bulemobi.activity.ac_login.Ac_Login;
import com.bulemobi.activity.ac_login.Ac_Register;
import com.bulemobi.activity.ac_message.Ac_Message;
import com.bulemobi.activity.ac_userCentre_Setting.Ac_Setting_up;
import com.bulemobi.data.DataCentre;
import com.bulemobi.net.tsz.afinal.annotation.view.ViewInject;
import com.bulemobi.view.BaseActivity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import com.jsyh.hcb.R;

import java.util.ArrayList;

/**
 * @author zengys 个人中心
 *         <p/>
 *         2014年9月17日 12:54:17
 */
public class PersonCentreActivity extends BaseActivity implements OnClickListener {
    @ViewInject(id = R.id.tv_feedBack)
    TextView tv_edit;
    @ViewInject(id = R.id.tv_login)
    TextView tv_login;
    @ViewInject(id = R.id.tv_register)
    TextView tv_register;
    @ViewInject(id = R.id.tv_back)
    TextView tv_back;

    @ViewInject(id = R.id.vw_myBank)
    RelativeLayout vw_myBank;
    @ViewInject(id = R.id.vw_myCar)
    RelativeLayout vw_myCar;
    @ViewInject(id = R.id.vw_myData)
    RelativeLayout vw_myData;
    @ViewInject(id = R.id.vw_myMsg)
    RelativeLayout vw_myMsg;
    @ViewInject(id = R.id.vw_myPay)
    RelativeLayout vw_myPay;
    @ViewInject(id = R.id.vw_myPic)
    RelativeLayout vw_myPic;
    @ViewInject(id = R.id.vw_setting)
    RelativeLayout vw_setting;
    @ViewInject(id = R.id.tv_userName)
    TextView tv_userName;

    private ImageView img_pic1, img_pic2, img_pic3, img_pic4, img_pic5, img_pic6, img_pic7;
    private ArrayList<ImageView> imgList;
    public static int mPosition;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ac_user_centre_main);
        initView();
    }

    @Override
    protected void onRestart() {
        if(DataCentre.isLogin){

        }
        super.onRestart();
    }

    public void initView() {
        img_pic1 = (ImageView) findViewById(R.id.img_pic1);
        img_pic2 = (ImageView) findViewById(R.id.img_pic2);
        img_pic3 = (ImageView) findViewById(R.id.img_pic3);
        img_pic4 = (ImageView) findViewById(R.id.img_pic4);
        img_pic5 = (ImageView) findViewById(R.id.img_pic5);
        img_pic6 = (ImageView) findViewById(R.id.img_pic6);
        img_pic7 = (ImageView) findViewById(R.id.img_pic7);
        imgList = new ArrayList<ImageView>();
        imgList.add(img_pic1);
        imgList.add(img_pic2);
        imgList.add(img_pic3);
        imgList.add(img_pic4);
        imgList.add(img_pic5);
        imgList.add(img_pic6);
        imgList.add(img_pic7);
        tv_login.setOnClickListener(this);
        tv_register.setOnClickListener(this);
        tv_back.setOnClickListener(this);
        tv_edit.setOnClickListener(this);
        vw_myBank.setOnClickListener(this);
        vw_myCar.setOnClickListener(this);
        vw_myData.setOnClickListener(this);
        vw_myMsg.setOnClickListener(this);
        vw_myPay.setOnClickListener(this);
        vw_setting.setOnClickListener(this);
        vw_myPic.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //返回键
            case R.id.tv_back:
                finish();
                break;
            //用户反馈
            case R.id.tv_feedBack:
                openActivity(AcFeedback.class);
                break;
            //设置
            case R.id.vw_setting:
                img_pic1.setBackgroundResource(R.drawable.icon);
                img_pic2.setBackgroundResource(R.drawable.icon1);
                img_pic3.setBackgroundResource(R.drawable.icon2);
                img_pic4.setBackgroundResource(R.drawable.icon3);
                img_pic5.setBackgroundResource(R.drawable.icon4);
                img_pic6.setBackgroundResource(R.drawable.icon5);
                img_pic7.setBackgroundResource(R.drawable.icon13);
                openActivity(Ac_Setting_up.class);
                break;
            //我的银行卡
            case R.id.vw_myBank:
                img_pic1.setBackgroundResource(R.drawable.icon);
                img_pic2.setBackgroundResource(R.drawable.icon8);
                img_pic3.setBackgroundResource(R.drawable.icon2);
                img_pic4.setBackgroundResource(R.drawable.icon3);
                img_pic5.setBackgroundResource(R.drawable.icon4);
                img_pic6.setBackgroundResource(R.drawable.icon5);
                img_pic7.setBackgroundResource(R.drawable.icon6);
                openActivity(Ac_MyBankActivity.class);
                break;
            //我的缴费
            case R.id.vw_myPay:
                img_pic1.setBackgroundResource(R.drawable.icon);
                img_pic2.setBackgroundResource(R.drawable.icon1);
                img_pic3.setBackgroundResource(R.drawable.icon9);
                img_pic4.setBackgroundResource(R.drawable.icon3);
                img_pic5.setBackgroundResource(R.drawable.icon4);
                img_pic6.setBackgroundResource(R.drawable.icon5);
                img_pic7.setBackgroundResource(R.drawable.icon6);
                openActivity(Ac_MyPay.class);
                break;
            //我的图片
            case R.id.vw_myPic:
                img_pic1.setBackgroundResource(R.drawable.icon);
                img_pic2.setBackgroundResource(R.drawable.icon1);
                img_pic3.setBackgroundResource(R.drawable.icon2);
                img_pic4.setBackgroundResource(R.drawable.icon10);
                img_pic5.setBackgroundResource(R.drawable.icon4);
                img_pic6.setBackgroundResource(R.drawable.icon5);
                img_pic7.setBackgroundResource(R.drawable.icon6);
                openActivity(PictrueDetalisActivity.class);
                break;
            //我的消息
            case R.id.vw_myMsg:
                img_pic1.setBackgroundResource(R.drawable.icon);
                img_pic2.setBackgroundResource(R.drawable.icon1);
                img_pic3.setBackgroundResource(R.drawable.icon2);
                img_pic4.setBackgroundResource(R.drawable.icon3);
                img_pic5.setBackgroundResource(R.drawable.icon11);
                img_pic6.setBackgroundResource(R.drawable.icon5);
                img_pic7.setBackgroundResource(R.drawable.icon6);
                openActivity(Ac_Message.class);
                break;
            //我的车辆
            case R.id.vw_myCar:
                img_pic1.setBackgroundResource(R.drawable.icon7);
                img_pic2.setBackgroundResource(R.drawable.icon1);
                img_pic3.setBackgroundResource(R.drawable.icon2);
                img_pic4.setBackgroundResource(R.drawable.icon3);
                img_pic5.setBackgroundResource(R.drawable.icon4);
                img_pic6.setBackgroundResource(R.drawable.icon5);
                img_pic7.setBackgroundResource(R.drawable.icon6);
                Intent intent = new Intent();
                intent.putExtra(DataCentre.ACNAME, DataCentre.AC_USERCENTRE);
                openActivityIntent(Ac_MyCar.class, intent);
                break;
            //我的资料
            case R.id.vw_myData:
                img_pic1.setBackgroundResource(R.drawable.icon);
                img_pic2.setBackgroundResource(R.drawable.icon1);
                img_pic3.setBackgroundResource(R.drawable.icon2);
                img_pic4.setBackgroundResource(R.drawable.icon3);
                img_pic5.setBackgroundResource(R.drawable.icon4);
                img_pic6.setBackgroundResource(R.drawable.icon12);
                img_pic7.setBackgroundResource(R.drawable.icon6);
                openActivity(Ac_MyData.class);
                break;
//            登陆
            case R.id.tv_login:
                openActivity(Ac_Login.class);
                break;
            //注册
            case R.id.tv_register:
                openActivity(Ac_Register.class);
                break;
            default:
                break;
        }
    }
}
